package collection02;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionOperDemo {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        c.add("java");
        c.add("c++");
        c.add(".nat");
        System.out.println(c);

        Collection c1 =new ArrayList();
        c1.add("ios");
        c1.add("android");
        c1.add("java");
        System.out.println(c1);

        c.addAll(c1);
        System.out.println(c);

        Collection c2=new ArrayList();
        c2.add(".nat");
        c2.add("ios");
        c2.add("php");
        System.out.println(c2);

        boolean num =c.containsAll(c2);
        System.out.println("是否包含："+num);

       /* c.retainAll(c2);
        System.out.println(c);*/

        c.removeAll(c2);
        System.out.println(c);
        System.out.println(c2);


    }
}
